<?php include THEMES_PATH.'public/before_body2.phtml'; ?>
<link href="<?php echo TPL_PATH;?>special/seckilling/css/style.css" rel="stylesheet">
</head>
<body>
<?php include THEMES_PATH.'public/header2.phtml'; ?>
<div class="align-center banner">
  <div class="banner-inner">
    <div class="back">
      <div class="upper">
        <span class="day">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens daysUpLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units daysUpRightBack" />
        </span>
        <i>.</i>
        <span class="hour">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens hoursUpLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units hoursUpRightBack" />
        </span>
        <i>.</i>
        <span class="minute">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens minutesUpLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units minutesUpRightBack" />
        </span>
        <i>.</i>
        <span class="second">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens secondsUpLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units secondsUpRightBack" />
        </span>
      </div>
      <div class="lower">
        <span class="day">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens daysDownLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units daysDownRightBack" />
          <em><?php echo L('seckill_time_1')?></em>
        </span>
        <i>.</i>
        <span class="hour">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens hoursDownLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units hoursDownRightBack" />
          <em><?php echo L('seckill_time_2')?></em>
        </span>
        <i>.</i>
        <span class="minute">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens minutesDownLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units minutesDownRightBack" />
          <em><?php echo L('seckill_time_3')?></em>
        </span>
        <i>.</i>
        <span class="second">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens secondsDownLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units secondsDownRightBack" />
          <em><?php echo L('seckill_time_4')?></em>
        </span>
      </div>
    </div>
    <div class="front">
      <div class="upper">
        <span class="day">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens daysUpLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units daysUpRight" />
        </span>
        <i>.</i>
        <span class="hour">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens hoursUpLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units hoursUpRight" />
        </span>
        <i>.</i>
        <span class="minute">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens minutesUpLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units minutesUpRight" />
        </span>
        <i>.</i>
        <span class="second">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens secondsUpLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units secondsUpRight" />
        </span>
      </div>
      <div class="lower">
        <span class="day">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens daysDownLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units daysDownRight" />
        </span>
        <i>.</i>
        <span class="hour">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens hoursDownLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units hoursDownRight" />
        </span>
        <i>.</i>
        <span class="minute">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens minutesDownLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units minutesDownRight" />
        </span>
        <i>.</i>
        <span class="second">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens secondsDownLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units secondsDownRight" />
        </span>
      </div>
    </div>
  </div>
  <p class="statestr"><?php echo L('Limited_Time_Offer');?></p>
</div>
<div class="main-width">
  <ul class="list js-list">    
    <?php 
      foreach($productList as $key => $product){
    ?> 
    <li>
       <div class="img-area">
          <a id="pid_<?php echo $product['id'];?>" href="<?php echo $product['url'];?>">
          <?php
    
            $list=$product['goods_img'] ? $product['goods_img'] : $product['list_img'];
            $str="<img src='".$product['list_img']."' data-original='".$list."' alt='".$product['name']."' />";
            if(!empty($product['ml_img'])) $str.="<img src='".$product['ml_img']."' data-original='".$product['ml_img']."' class='hide' />";
            echo $str;
          ?>
          <span class="countdown"><?php echo L('seckill_state_1');?></span>
          </a>
          <div class="mask-box" style="display:none;">
              <p><?php echo L('pic_intro_1');?><a href="<?php echo $product['url'];?>" class="btn active"><?php echo L('pic_intro_2');?></a></p>
          </div>
      </div>
      <strong><?php echo $product['name'];?></strong>
      <del>
      <?php 
/*        if($original_price > 0){
          $three_price = currency($product['original_price']);
          $three_result="<del>$three_price</del>";
            echo $three_result;
          }	*/
           if($product['attribute_type']==2){
              if($product['product_type']){
                  echo currency($product['sell_price']);
              }else{
                  echo currency($product['advanced_price']);
              }
          }elseif($product['attribute_type']==1){
              echo currency($product['custom_price']);
          }
      ?>
      </del>
      <p><?php echo currency($product['seckill']['price']);?></p>
      <a class="btn luckurl" href="javascript:void(0);" onClick="gotohref(this);" gotohref="" tid="<?php echo $product['seckill']['id'];?>"><?php echo L('seckill_state_1');?></a>
    </li>
	<?php
      }
    ?>   
  </ul>
  <p class="heading">
    <strong><?php echo L('Game_rule');?></strong>
  </p>
  <ul class="clearfix rule">
    <li class="rule-item<?php if($islogin):?> item-ok<?php endif;?>">
      <i>1</i>
      <p><?php echo L('Game_rule_1');?></p>
      <a href="<?php if(!$islogin) {echo url('user/login',array('src' => base64_encode(url('activity/seckill_goto'))));}else{echo "javascript:void(0);";}?>" class="btn <?php if($islogin) echo 'btn1';?>"><?php echo L('login');?>/<?php echo L('register');?></a>
    </li>
    <li class="rule-item <?php if($issetm):?> item-ok<?php endif;?>" style="border-right:none;">
      <i>2</i>
      <p><?php echo L('Game_rule_2');?></p>
      <a href="<?php if(!$issetm) {echo url('measure/add', 'type=goto&jump_src='.base64_encode('activity/seckill'));}else{echo "javascript:void(0);";}?>" class="btn <?php if($issetm) echo 'btn1';?>"><?php echo L('get_measure_now');?></a>
    </li>
    <li style="width:96%;border-top:1px dashed #8a8a8a;">
      <p><?php echo L('rule_1');?></p>
      <p class="graphic">
        <span class="btn" style="background-color:#777;"><?php echo L('seckill_state_1');?></span>
        <span class="arrow"></span>
        <span class="btn"><?php echo L('seckill_state_2');?></span>
      </p>
      <p><?php echo L('rule_2');?></p>
      <p><?php echo L('rule_3');?></p>
    </li>
  </ul>
  <input type="hidden" value="<?php echo $info['id'];?>" id="fid" />
  <input type="hidden" value="<?php echo $info['times'];?>" id="times" />
  <input type="hidden" value="<?php echo $info['state'];?>" id="state" />
  <input type="hidden" value="0" id="start_timestamp" />
  <input type="hidden" value="0" id="end_timestamp" />
  <input type="hidden" value="<?php echo $islogin ? 1: 0;?>" id="islogin" />
  <input type="hidden" value="<?php echo $issetm ? 1: 0;?>" id="issetm" />
  <input type="hidden" value="0" id="tiwu" />
</div>
<div class="main-width align-center goods js-goods">
  <p><?php echo L('_You_May_Also_Like_');?></p>
  <ul>
    <?php
      foreach ($productArrList as $k => $product) :
    ?>
    <li>
      <a href="<?php echo $product['url'];?>">
        <img src="<?php echo $product['goods_img'];?>" alt="<?php echo $product['name'];?>" />
        <img src="<?php echo $product['ml_img'];?>" alt="<?php echo $product['name'];?>" class="hide" />
      </a>
      <a href="<?php echo $product['url'];?>">
        <strong><?php echo $product['name'];?></strong>
        <p>
          <?php
            if($product['attribute_type']==2){
                if($product['product_type']){
                    echo currency($product['sell_price']);
                }else{
                    echo currency($product['advanced_price']);
                }
            }elseif($product['attribute_type']==1){
                echo currency($product['custom_price']);
            }
          ?>
        </p>
      </a>
    </li>
    <?php
      endforeach;
    ?>  
  </ul>
</div>
<div class="align-center banner">
  <div class="banner-inner">
    <div class="back">
      <div class="upper">
        <span class="day">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens daysUpLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units daysUpRightBack" />
        </span>
        <i>.</i>
        <span class="hour">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens hoursUpLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units hoursUpRightBack" />
        </span>
        <i>.</i>
        <span class="minute">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens minutesUpLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units minutesUpRightBack" />
        </span>
        <i>.</i>
        <span class="second">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens secondsUpLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units secondsUpRightBack" />
        </span>
      </div>
      <div class="lower">
        <span class="day">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens daysDownLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units daysDownRightBack" />
          <em><?php echo L('seckill_time_1')?></em>
        </span>
        <i>.</i>
        <span class="hour">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens hoursDownLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units hoursDownRightBack" />
          <em><?php echo L('seckill_time_2')?></em>
        </span>
        <i>.</i>
        <span class="minute">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens minutesDownLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units minutesDownRightBack" />
          <em><?php echo L('seckill_time_3')?></em>
        </span>
        <i>.</i>
        <span class="second">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens secondsDownLeftBack" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units secondsDownRightBack" />
          <em><?php echo L('seckill_time_4')?></em>
        </span>
      </div>
    </div>
    <div class="front">
      <div class="upper">
        <span class="day">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens daysUpLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units daysUpRight" />
        </span>
        <i>.</i>
        <span class="hour">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens hoursUpLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units hoursUpRight" />
        </span>
        <i>.</i>
        <span class="minute">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens minutesUpLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units minutesUpRight" />
        </span>
        <i>.</i>
        <span class="second">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="tens secondsUpLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/upper/0.png" class="units secondsUpRight" />
        </span>
      </div>
      <div class="lower">
        <span class="day">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens daysDownLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units daysDownRight" />
        </span>
        <i>.</i>
        <span class="hour">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens hoursDownLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units hoursDownRight" />
        </span>
        <i>.</i>
        <span class="minute">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens minutesDownLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units minutesDownRight" />
        </span>
        <i>.</i>
        <span class="second">
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="tens secondsDownLeft" />
          <img src="<?php echo TPL_PATH;?>special/seckilling/images/lower/0.png" class="units secondsDownRight" />
        </span>
      </div>
    </div>
  </div>
  <p class="statestr"><?php echo L('Limited_Time_Offer');?></p>
</div>
<script src="<?php echo TPL_PATH; ?>js/plugins/jquery.popupBox.js"></script>
<script>
function alertShow(type, str ,button, url){	
   if(type == 1){
		$(document).popupBox({
			eventType: null,
			quickClose: true,
			button: [button],
			content: function() {
			  return str;
			},
			onOk:function(){
			   window.location.href = url
			}
		});	   
   }else{
		$(document).popupBox({
			eventType: null,
			quickClose: true,
			content: function() {
			  return str;
			}
		});
   }
}

function alertShow_pro(str, url){
	if(str == 'login'){
		str = "<?php echo L('seckill_str_1');?>";
		button = "<?php echo L('login');?>/<?php echo L('register');?>";
		url = "<?php echo url('user/login',array('src' => base64_encode(url('activity/seckill_goto'))));?>";  
	    alertShow(1, str ,button, url);
	}else if(str == 'setm'){
		str = "<?php echo L('seckill_str_2');?>";
		button = "<?php echo L('get_measure_now');?>";
		url = "<?php echo url('measure/add', 'type=goto&jump_src='.base64_encode('activity/seckill'));?>";
		alertShow(1, str ,button, url);
	}else if(str == 'sccess'){
		str = "<?php echo L('seckill_str_4');?>";
		button = "<?php echo L('_DO_IT_NOW_')?>";
	    alertShow(1, str ,button, url);
	}else{
	    alertShow(0, str ,'', '');
	}
}
</script>
<script type="text/javascript">
var sh;
var tvs = false;
var tvs_time  = 5000;
var tvs_time2 = 2000;

var d1_current = -1,
d2_current = -1,
h1_current = -1,
h2_current = -1,
m1_current = -1,
m2_current = -1,
s1_current = -1,
s2_current = -1;

function flip(upperId, lowerId, changeNumber, pathUpper, pathLower) {//图片翻转
  var upperBackId = upperId + 'Back',
  lowerBackId = lowerId + 'Back';
  $(upperId).attr('src', $(upperBackId).attr('src')).css('height', 64).animate({'height': 0}, 200, function() {
    var src = $(this).attr('src').slice($(this).attr('src').lastIndexOf('/') + 1),
    srcNumber = src.match(/^\d+/)[0];
    $(lowerBackId).attr('src', pathLower + srcNumber + '.png');
    $(lowerId).attr('src', pathLower + parseInt(changeNumber) + '.png').css('height', 0).animate({'height': 64}, 200);
  });
  $(upperBackId).attr('src', pathUpper + parseInt(changeNumber) + '.png');
}

//倒计时
function fresh(){
  var time = $('#times').val();
  var leftsecond=parseInt(time);
  if(leftsecond < 0) {
    return false;
  }

  var day = parseInt(leftsecond/3600/24),
  hours = parseInt(leftsecond/3600%24),
  minutes = parseInt(leftsecond/60%60),
  seconds = parseInt(leftsecond%60);
  
  if(day < 10) {day = '0' + day;}
  if(hours < 10) {hours = '0'+ hours;}
  if(minutes < 10) {minutes = '0' + minutes;}
  if(seconds < 10) {seconds = '0' + seconds;}

  var d1 = day.toString().split('')[0],
  d2 = day.toString().split('')[1],
  h1 = hours.toString().split('')[0],
  h2 = hours.toString().split('')[1],
  m1 = minutes.toString().split('')[0],
  m2 = minutes.toString().split('')[1],
  s1 = seconds.toString().split('')[0],
  s2 = seconds.toString().split('')[1];

  if($('#state').val() == '1') {
		var upperPath = '<?php echo TPL_PATH;?>special/seckilling/images/upper/',
		lowerPath = '<?php echo TPL_PATH;?>special/seckilling/images/lower/';
	
		if (d2_current !== 0) {
		  flip('.daysUpRight', '.daysDownRight', 0, upperPath, lowerPath);
		  d2_current = 0;
	
		  flip('.daysUpLeft', '.daysDownLeft', 0, upperPath, lowerPath);
		  d1_current = 0;
		}
	
		if (h2_current !== 0) {
		  flip('.hoursUpRight', '.hoursDownRight', 0, upperPath, lowerPath);
		  h2_current = 0;
	
		  flip('.hoursUpLeft', '.hoursDownLeft', 0, upperPath, lowerPath);
		  h1_current = 0;
		}
	
		if (m2_current !== 0) {
		  flip('.minutesUpRight', '.minutesDownRight', 0, upperPath, lowerPath);
		  m2_current = 0;
	
		  flip('.minutesUpLeft', '.minutesDownLeft', 0, upperPath, lowerPath);
		  m1_current = 0;
		}
	
		if (s2_current !== 0) {
		  flip('.secondsUpRight', '.secondsDownRight', 0, upperPath, lowerPath);
		  s2_current = 0;
	
		  flip('.secondsUpLeft', '.secondsDownLeft', 0, upperPath, lowerPath);
		  s1_current = 0;
		}
  } else {
		var upperPath = '<?php echo TPL_PATH;?>special/seckilling/images/upper/',
		lowerPath = '<?php echo TPL_PATH;?>special/seckilling/images/lower/';
	
		if (d2_current !== d2) {
		  flip('.daysUpRight', '.daysDownRight', d2, upperPath, lowerPath);
		  d2_current = d2;
	
		  flip('.daysUpLeft', '.daysDownLeft', d1, upperPath, lowerPath);
		  d1_current = d1;
		}
	
		if (h2_current !== h2) {
		  flip('.hoursUpRight', '.hoursDownRight', h2, upperPath, lowerPath);
		  h2_current = h2;
	
		  flip('.hoursUpLeft', '.hoursDownLeft', h1, upperPath, lowerPath);
		  h1_current = h1;
		}
	
		if (m2_current !== m2) {
		  flip('.minutesUpRight', '.minutesDownRight', m2, upperPath, lowerPath);
		  m2_current = m2;
	
		  flip('.minutesUpLeft', '.minutesDownLeft', m1, upperPath, lowerPath);
		  m1_current = m1;
		}
	
		if (s2_current !== s2) {
		  flip('.secondsUpRight', '.secondsDownRight', s2, upperPath, lowerPath);
		  s2_current = s2;
	
		  flip('.secondsUpLeft', '.secondsDownLeft', s1, upperPath, lowerPath);
		  s1_current = s1;
		}
	}
	
	if($('#state').val() == '0'){
	   $(".countdown").html('<?php echo L('seckill_state_1');?>'); 
	}else if($('#state').val() == '1'){
	   $(".countdown").html(h1+h2+':'+m1+m2+':'+s1+s2); 
	}else{
	   $(".countdown").html('00:00:00'); 
	}
	
	leftsecond -= 1;
	if(leftsecond >= 0) {
		if($('#state').val() == '0' && leftsecond == 0 ){
			timeverify();
		}
		if($('#state').val() == '0' && leftsecond < 30 && tvs_time != tvs_time2){
		    if(tvs) clearInterval(tvs);
			tvs_time = tvs_time2;
			tvs = setInterval(timeverify,tvs_time);
		}
	    $('#times').val(leftsecond);
	}
	if($('#state').val() == '2' &&  tvs_time != 5000){
		if(tvs) clearInterval(tvs); 
		tvs_time = 5000;
		tvs = setInterval(timeverify,tvs_time);
	}
}

var time = $('#times').val();
fresh();
sh=setInterval(fresh, 1000);

//校正时间及状态处理
function timeverify(){
  var fid = $('#fid').val();
  var timestamp=new Date().getTime();
	$('#start_timestamp').val(timestamp);
	
	var successProcess=function(res){
		var res = eval('(' + res + ')'); 
		if(res['state']==3){ window.location.href = window.location.href;return; }
		if(res['loginstate']==false && $('#islogin').val()=='1'){
		    window.location.href = window.location.href;return;
		}	
		var href="";
		if(res['state']==0){
		    $(".luckurl").each(function(i){
			    $(this).attr('gotohref',href).text('<?php echo L('seckill_state_1');?>').removeClass('active');
			 });
		}else if(res['state']==1){
		    $(".luckurl").each(function(i){
				var tid = $(this).attr('tid');
				if(res['returninfo'][tid]['isok'] == 1){
				    $(this).attr('gotohref',res['returninfo'][tid]['luckurl']).text('<?php echo L('seckill_state_2');?>').addClass('active');
				}else if(res['returninfo'][tid]['isok'] == 2){
				    $(this).attr('gotohref',href).text('<?php echo L('seckill_state_2');?>').removeClass('active');
				}else{
				    $(this).attr('gotohref',href).text('<?php echo L('seckill_state_2');?>').removeClass('active');
				}
			 });
		}else if(res['state']==2){
		    $(".luckurl").each(function(i){
			    $(this).attr('gotohref',href).text('<?php echo L('seckill_state_2');?>').removeClass('active');
			 });
			 $('.statestr').html('<?php echo L('seckill_game_over');?>');   
		}
		$('#state').val(res['state']);
		var timestamp=new Date().getTime();
		$('#end_timestamp').val(timestamp);
		//修改时间大于一秒 校正
		var time = $('#times').val();
		if( Math.abs(parseInt(res['times']) - parseInt(time)) > 1  ){
		   $('#times').val(res['times']);
		}

	};
	$.ajax({
		type: 'POST',
		url: "<?php echo U('activity/seckill_ajax');?>",
		data: {'timeverify':1, 'fid':fid},
		cache:false,
		timeout:5000,
		success: successProcess
	})	    	
}
timeverify();

if (($('#state').val() == '1')) {
  tvs_time = tvs_time2
}
if(!tvs) tvs = setInterval(timeverify,tvs_time);

function gotohref(obj) {
  if($('#islogin').val() != '1') {
    alertShow_pro('login', '');
    return;
  }
  if($('#issetm').val() != '1'){
     alertShow_pro('setm',  '');
     return;
  }
  var gotohref = $(obj).attr('gotohref');
  if(gotohref != "") {
    var successProcess=function(res) {
      var res = eval('(' + res + ')');
      if(res['errNo'] == 201){
         var url = $('#pid_'+res['pid']).attr('href');
         alertShow_pro('sccess',  url);
      }else{
         alertShow_pro(res['errStr'],  '');
      }

    };
    $.ajax({
      type: 'POST',
      url: gotohref,
      cache: false,
      async: false,
      success: successProcess
    });
  }
}
$('.img-area').mouseover(function(){
	if($('#state').val() == '1'){
	    $(this).find(".mask-box").show();
	}	
});
$('.img-area').mouseout(function(){
	$(this).find(".mask-box").hide();
});

$(function() {
  (function() {
    var $list = $('.js-list'),
    countPerRow = 4; //每行4个
    if ($list.find('li').length && $list.find('li').length < countPerRow) {
  	  $list.addClass('align-center');
    }
  })();
  
  (function() {
    if(!unifyMobileDesktop.isSupportTouch()) {
      $('.js-goods').on('mouseover', 'li', function() {
        var $img = $(this).children(':first').find('img');
        $img.removeAttr('style');
        if ($img.length > 1) {
          $img.eq(0).addClass('hide').next().removeClass('hide');
        }
      }).on('mouseout', 'li', function() {
        var $img = $(this).children(':first').find('img');
        if ($img.length > 1) {
          $img.eq(0).removeClass('hide').next().addClass('hide');
        }
      });
    }
  })();
});
</script>
<?php include THEMES_PATH.'public/footer2.phtml'; ?>

<?php include THEMES_PATH.'public/after_body.phtml'; ?>